package com.tdam2011.grupo02.ui;

import android.content.Context;

public class ContactsManagerSingleton {

	private ContactsManager contactsManager = null;
	private static ContactsManagerSingleton contactsManagerSingleton = null;

	private ContactsManagerSingleton(Context context) {
		contactsManager = new ContactsManager(context);
	}

	private static void createInstance(Context context) {
		if (contactsManagerSingleton == null)
			contactsManagerSingleton = new ContactsManagerSingleton(context);
	}

	public static ContactsManagerSingleton getInstance(Context context) {
		if (contactsManagerSingleton == null)
			createInstance(context);
		
		return contactsManagerSingleton;
	}
	
	public ContactsManager getContactsManager() {
		return contactsManager;
	}
}
